# Contributor: Alexander Georgievskiy <galeksandrp@gmail.com>
# Contributor: Rafael Kitover <rkitover@gmail.com>

_realname=cccl
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.2
pkgrel=1
pkgdesc="Unix cc compiler to Microsoft's cl compiler wrapper (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
license=('GPL')
makedepends=("${MINGW_PACKAGE_PREFIX}-autotools")
url="https://github.com/swig/${_realname}"
source=("${url}/archive/${_realname}-${pkgver}.tar.gz")
sha256sums=('1936206faaaca61c4ffa062df1d760775b89a82fdf222ef3d4a24c604a64b036')

prepare() {
  cd ${srcdir}/${_realname}-${_realname}-${pkgver}

  ./bootstrap
}

build() {
  cd ${srcdir}/${_realname}-${_realname}-${pkgver}

  ./configure --prefix=${MINGW_PREFIX}
  make
}

package() {
  cd ${srcdir}/${_realname}-${_realname}-${pkgver}

  make DESTDIR=${pkgdir} install
}
